import java.util.ArrayList;

public class TwoSat {
    class Expression{
        int first;
        int second;
    };
    int curPos = 0;
    int []x;
    int count;
    ArrayList<Expression> expressions;

    public void InitData(){
        DataReader reader = new DataReader();
        reader.SetFilename("C:\\tmp\\4_true.txt");

        String str;
        str = reader.GetNextLine();
        count = Integer.parseInt(str);
        x = new int[count];

        expressions = new ArrayList<Expression>(count);

        while((str = reader.GetNextLine()) != null) {
            String[] parser = str.split(" ");
            Expression e = new Expression();
            e.first = Integer.parseInt(parser[0]) - 1;
            e.second = Integer.parseInt(parser[1]) - 1;
            expressions.add(e);
        }
    }
    public void PrintData(){
        for(int i = 0; i < count; i++)
        {
            Expression e = expressions.get(i);
            System.out.println((e.first + 1) + " " + (e.second + 1));
        }
    }
    public void Run2Sat(){
        while(true){
            if(x[curPos] == -1)
                x[curPos] = 0;
            else if(x[curPos] == 0)
                x[curPos] = 1;
            else if(curPos > 0)
            {
                //backtrack
                curPos--;
                continue;
            }
            else
                break;
        }
    }

}
